import Vue from 'vue'
import Vuex from 'vuex'
import userInfor from './userInfor.js'
import cart from './cart.js'
import vuexPersist from 'vuex-persist'

const vuexLocal = new vuexPersist({
  storage:window.localStorage
})

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    uname:'',
    password:''
  },
  getters: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    userInfor,
    cart
  },
  // plugins  安装插件
  // vuex-persist 作用让vuex的数据变成长久储存
  plugins:[vuexLocal.plugin]
})
